import { lazy } from "react";
import type { RouteObject } from "react-router-dom";

const Document = lazy(() => import("@/pages/document/index"));
const Table = lazy(() => import("@/pages/table/index"));
const Detail = lazy(() => import("@/pages/table/detail"));
const Nest1 = lazy(() => import("@/pages/nest/nest1"));
const Nest2 = lazy(() => import("@/pages/nest/nest2"));
const Permission = lazy(() => import("@/pages/permission/index"));

// 权限路由
const permissionRoutes: RouteObject[] = [
  {
    path: "/document",
    element: <Document />
  },
  {
    path: "/table",
    element: <Table />
  },
  {
    path: "/table/detail",
    element: <Detail />
  },
  {
    path: "/nest",
    children: [
      {
        path: "/nest/nest1",
        element: <Nest1 />
      },
      {
        path: "/nest/nest2",
        element: <Nest2 />
      }
    ]
  },
  {
    path: "/permission",
    element: <Permission />
  }
];

export default permissionRoutes;
